Open
Conversation
yurii-litvinov
suggested changes
May 25, 2023
| @@ -0,0 +1,3 @@ | |||
| namespace ListAndUniqueList; | |||
|
|
|||
| public class InvalidItemException : Exception {} No newline at end of file | |||
There was a problem hiding this comment.
Надо комментарии и к исключениям тоже
| @@ -0,0 +1,123 @@ | |||
| namespace ListAndUniqueList; | |||
|
|
|||
| // Container for storing values | |||
There was a problem hiding this comment.
Надо комментарии в правильном формате :)
Comment on lines
6
to
7
| public ListElement? Head; | ||
| public ListElement? Tail; |
| { | ||
| if (Head == null) | ||
| { | ||
| ListElement item = new ListElement(value, 0); |
There was a problem hiding this comment.
Suggested change
| ListElement item = new ListElement(value, 0); | |
| var item = new ListElement(value, 0); |
|
|
||
| class Program | ||
| { | ||
| public static void Main(string[] args) |
Comment on lines
47
to
50
| public override bool IsEmpty() | ||
| { | ||
| return base.IsEmpty(); | ||
| } |
|
|
||
| public class Tests | ||
| { | ||
| List list; |
There was a problem hiding this comment.
Suggested change
| List list; | |
| private List list; |
Comment on lines
+15
to
+16
| [TestCaseSource(nameof(ListForTest))] | ||
| public void ListShouldBeEmptyWhenCreated(List list) |
There was a problem hiding this comment.
А зачем тогда поле list? :) Уберите TestCaseSource, либо добавьте уникальный список туда, чтобы эти тесты сразу два проверяли.
| list.AddElement(10); | ||
| int item = 0; | ||
| list.RemoveElement(ref item); | ||
| Assert.True(item == 10); |
| } | ||
|
|
||
| [TestCaseSource(nameof(ListForTest))] | ||
| public void UniqueListShouldBeEmptyWhenCreated(UniqueList uniqueList) |
There was a problem hiding this comment.
Ну, копипаст. Оставьте тут только тесты, которые должны работать для UniqueList, но не должны для List, а остальное тестируйте тестами выше
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
4 дз